/**
 * 第i个女巫要Ai个金币才开心，一共有X个金币，最多几个女巫开心
 * 排序以后贪心即可
 */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

template <typename T>
const T & mymax(const T & a, const T & b){
    return max(a, b);
}

template<typename T, typename ... Args>
const T & mymax(const T & t, const Args & ... args){
    return max(t, mymax(args ...));
}

template<typename T>
void input(vector<T> & v, int n){
	v.assign(n + 1, {});
    for(int i=1;i<=n;++i) cin >> v[i];
	return;
}

template<typename T>
istream & operator >> (istream & is, vector<T> & v){
	for(auto & i : v) is >> i;
	return is;
}

using llt = long long;
using vi = vector<int>;
using vll = vector<llt>;
using pii = pair<int, int>;
using vpii =vector<pii>;

int N;
vi A;
int X;

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);   
    cin >> N >> X;
    A.assign(N, {});
    cin >> A;
    sort(A.begin(), A.end());
    int ans = 0;
    int left = X;
    for(auto i : A){
        if(left >= i){
            ans += 1;
        }else{
            break;
        }
    }
    cout << ans << " " << (ans ? left - A[ans - 1] : left) << endl;
    return 0;
}